﻿using System.Threading;
namespace System.Web
{
    public partial class NetHttpApplication
    {
        internal class MapHandlerExecutionStep : IExecutionStep
        {
            private NetHttpApplication _application;

            internal MapHandlerExecutionStep(NetHttpApplication app) { _application = app; }

            void IExecutionStep.Execute()
            {
                var context = _application.Context;
                var request = context.Request;
                context.Handler = _application.MapHttpHandler(context, request.RequestType, request.FilePath, request.PhysicalPath, false);
            }

            bool IExecutionStep.CompletedSynchronously
            {
                get { return true; }
            }

            bool IExecutionStep.IsCancellable
            {
                get { return false; }
            }
        }
    }
}
